<?php 
session_cache_expire(999999999);
if(!isset($_SESSION)) 
{ 
	session_start(); 
}
$lang = $_SESSION['lang'];
if (empty($lang) || $lang == "EN") {
	include "../value/value_en.php";
} else if($lang == "VN") {
	include "../value/value_vn.php";
}
else {
	include "../value/value_kr.php";
}

$mang=$_SESSION['inputMoneys'];
$listmang=array();
$id=$_REQUEST['id'];
foreach ($mang as $value => $giatri){
	if($id==$giatri[0]){
		if($giatri[4]==0)
			$giatri[4]=1;
		else
			$giatri[4]=0;
	}
	$listmang[]=array($giatri[0],$giatri[1],$giatri[2],$giatri[3],$giatri[4],$giatri[5],$giatri[6]);
}
$mang=$listmang;
$_SESSION['inputMoneys']=$mang;
?>
<table cellpadding="0" cellspacing="1" border="0" class="ftable1" style="width: 100%;margin:auto;">
			<tr align='center'>
				<th style="width:30px;"><?=$l_no?></th>
				<th style="width:190px;"><?=$l_pay_category?></th>
				<th style="width:110px;"><?=$l_pay_time?></th>
				<th style="width:110px;"><?=$l_pay_money?></th>
				<th style="width:110px;"><?=$l_methodsPayment_contract?></th>
				<th style="width:110px;"><?=$l_note?></th>
				<th><?=$l_status?></th>
			</tr>
			
		<?php 
		$k=1;
		foreach ($mang as $value => $giatri){
			?>
							<tr>
								<td><?=$k?></td>
								<td class="tdfirst" style="text-align: left;"><?php echo $giatri[1];?></td>
								<td style="width: 100px;" ><input type="text" value="<?php echo $giatri['2'];?>" class="in_testfield" style="width:100px;float:left;height:24px;text-align: right; padding-right: 5px" readonly="readonly" disabled="disabled" /></td>
								<td ><input type="text" id="money<?=$k?>" name="money<?=$k?>" value="<?php echo $giatri[3];?>" onchange="chMoney(this.value,<?=$giatri[0]?>)" onkeyup="chMoney(this.value,<?=$giatri[0]?>)" <?php if($giatri[4]==1) echo 'disabled="disabled"';?>  class="in_testfield" style="width:100px;float:left;height:24px;text-align: right; padding-right: 5px"/></td>
								<td >
									<!-- <input type="text" id="method<?=$k?>" name="method<?=$k?>" value="<?php echo $l_method?>" disabled="disabled" style="width:140px;float:left;height:24px;text-align: left; "/>-->
									<select  id="method<?=$k?>" name="method[]" onchange="chmethod1(this.value,<?=$giatri[0]?>)" onkeyup="chmethod1(this.value,<?=$giatri[0]?>)" style="height: 24px;" <?php if($giatri[4]==1) echo 'disabled="disabled"';?>>
										<?php for ($i=0;$i<=5;$i++){
											$l_method="";
											if($i==0)
												$l_method=$l_method0;
											if($i==1)
												$l_method=$l_method1;
											if($i==2)
												$l_method=$l_method2;
											if($i==3)
												$l_method=$l_method3;
											if($i==4)
												$l_method=$l_method4;
											if($i==5)
												$l_method=$l_method5;
													
											if($giatri[5]==$i){
											?>
										<option value="<?=$i?>" selected="selected"><?=$l_method?></option>
											<?php }else{?>
										<option value="<?=$i?>"><?=$l_method?></option>
										<?php }
											}?>
									</select>
								</td>
								<td ><input type="text" id="note<?=$k?>" name="note<?=$k?>" value="<?php echo $giatri[6];?>" onchange="chNote(this.value,<?=$giatri[0]?>)" onkeyup="chNote(this.value,<?=$giatri[0]?>)" <?php if($giatri[4]==1) echo 'disabled="disabled"';?>  class="in_testfield" style="width:140px;float:left;height:24px;"/></td>
								<td ><?php if($giatri[4]==0){?>
									<img title="<?=$l_pay_status1?>" src="images/not_yet.png" onclick="chActive(<?=$giatri[0]?>,0)">
									<?php }else{?>
									<img title="<?=$l_pay_status2?>" src="images/check.png" onclick="chActive(<?=$giatri[0]?>,1)">
									<?php }?></td>
							</tr>
							
							<?php 
							$k++;
		}
		?>
			
		</table>